﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Microsoft.Windows.Controls.Ribbon;
using BookManagementWpfApplication.ViewModels;

namespace BookManagementWpfApplication.Views.UserControl
{
    /// <summary>
    /// Interaction logic for ListBookView.xaml
    /// </summary>
    public partial class ListBookView 
    {
        private ListBookViewModel _listBookViewModel;

        public ListBookView()
        {
            InitializeComponent();   
            _listBookViewModel = this.Resources["listBookViewModel"] as ListBookViewModel;
            this.filterTextBoxListBook.KeyUp += new KeyEventHandler(filterTextBoxListBook_KeyUp);

            
        }

        private void filterTextBoxListBook_KeyUp(object sender, KeyEventArgs e)
        {
            _listBookViewModel.FilterText = filterTextBoxListBook.Text;
            _listBookViewModel.Filter(filterTextBoxListBook.Text);
        }

        

                
    }
}
